package com.ctshk.rpc.scenic.mapper;

import com.ctshk.rpc.scenic.entity.AirshowDistributorSetting;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-06-10
 */
public interface AirshowDistributorSettingMapper extends BaseMapper<AirshowDistributorSetting> {

    @Update("UPDATE t_airshow_distributor_setting \n" +
            "SET balance = balance - #{surplusBalance} \n" +
            "WHERE id = #{id}")
    Integer surplusBalance(@Param("id") Long id, @Param("surplusBalance") BigDecimal surplusBalance);

    @Update("UPDATE t_airshow_distributor_setting \n" +
            "SET balance = balance + #{addBalance} \n" +
            "WHERE id = #{id}")
    Integer addBalance(@Param("id") Long id, @Param("addBalance") BigDecimal addBalance);


}
